package com.graduation.system.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * 功能：用户实体类 
 * 对应数据库表：SYS_USER 
 * 作者：王金竹
 * 时间：2016/11/15
 */

@Entity
@Table(name = "SYS_USER")
@DynamicInsert(true)
@DynamicUpdate(true)
public class SysUser implements Serializable{
	
	private static final long serialVersionUID = 8108624066152483877L;
	
	private Integer custId; // 客户id，唯一，自增长，主键
	private String telephone;//手机号码
	private String userName; // 用户名称，不唯一
	private String passWord; //登入密码
	private String school;//注册学校
	private Byte status;//状态：0为正常，1为移除（不是删除）
	
	
	@Id
	@Column(name = "CUST_ID", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO) // 自增长
	public Integer getCustId() {
		return custId;
	}
	
	public void setCustId(Integer custId) {
		this.custId = custId;
	}
	@NotEmpty
	@Column(name = "TELEPHONE", nullable = false)
	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	
	
	@NotEmpty
	@Column(name = "USER_NAME", nullable = false)
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	@NotEmpty
	@Column(name = "PASSWORD",nullable = false)
	public String getPassWord() {
		return passWord;
	}
	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}
	@NotEmpty
	@Column(name="SCHOOL",nullable =false)
	public String getSchool() {
		return school;
	}
	public void setSchool(String school) {
		this.school = school;
	}
	@Column(name = "STATUS", nullable = false, columnDefinition = "tinyint default 0")	
	public Byte getStatus() {
		return status;
	}
	public void setStatus(Byte status) {
		this.status = status;
	}

	
	
	
	
}
